-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang][doc] Simplify Sampling-PGO use example #162588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The -fprofile-sample-use implies codegenoptions::LocTrackingOnly. No need to explicitly specify -g if debug info is not required in final binary. Also fix -fuse-ld=lld.
@llvm/pr-subscribers-clang Author: Haohai Wen (HaohaiWen) ChangesThe -fprofile-sample-use implies codegenoptions::LocTrackingOnly. No need Also fix -fuse-ld=lld. Full diff: https://github.com/llvm/llvm-project/pull/162588.diff 1 Files Affected:
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 12c2ada062625..94f517829fc24 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2778,7 +2778,7 @@ usual build cycle when using sample profilers for optimization:
> clang-cl /O2 -gdwarf -gline-tables-only ^
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
- code.cc /Fe:code /fuse-ld=lld /link /debug:dwarf
+ code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
.. note::
@@ -2867,7 +2867,7 @@ usual build cycle when using sample profilers for optimization:
.. code-block:: console
- $ clang++ -O2 -gline-tables-only \
+ $ clang++ -O2 \
-fdebug-info-for-profiling -funique-internal-linkage-names \
-fprofile-sample-use=code.prof code.cc -o code
@@ -2875,7 +2875,7 @@ usual build cycle when using sample profilers for optimization:
.. code-block:: winbatch
- > clang-cl /O2 -gdwarf -gline-tables-only ^
+ > clang-cl /O2 ^
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
@@ -2886,7 +2886,7 @@ usual build cycle when using sample profilers for optimization:
.. code-block:: console
- $ clang++ -fsample-profile-use-profi -O2 -gline-tables-only \
+ $ clang++ -fsample-profile-use-profi -O2 \
-fdebug-info-for-profiling -funique-internal-linkage-names \
-fprofile-sample-use=code.prof code.cc -o code
@@ -2894,7 +2894,7 @@ usual build cycle when using sample profilers for optimization:
.. code-block:: winbatch
- > clang-cl /clang:-fsample-profile-use-profi /O2 -gdwarf -gline-tables-only ^
+ > clang-cl /clang:-fsample-profile-use-profi /O2 ^
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
|
clang/docs/UsersManual.rst
Outdated
> clang-cl /O2 -gdwarf -gline-tables-only ^ | ||
> clang-cl /O2 ^ | ||
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^ | ||
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want DWARF in the binary can we also emit some of the link options like -fuse-ld=lld
and /link /debug:dwarf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. LGTM!
The -fprofile-sample-use implies codegenoptions::LocTrackingOnly. No need
to explicitly specify -g if debug info is not required in final binary.
Also fix -fuse-ld=lld.